<?php

namespace App\Transformers;


class UserTransformer
{
    static public function transform($user)
    {
        return [
            'id' => $user->id,
            'is_member' => $user->is_member,
            'level' => $user->level,
            'phone' => $user->phone,
            'email' => $user->email,
            'nickname' => $user->nickname,
            'avatar' => config('app.url').'/uploads/'.$user->avatar,
            'code' => $user->code,
            'created_at' => $user->created_at->toDateTimeString(),
            'updated_at' => $user->updated_at->toDateTimeString(),
        ];
    }
}






















